package com.lone.demo.factorypattern;

import com.lone.demo.factorypattern.factory.Dialog;
import com.lone.demo.factorypattern.factory.HtmlDialog;
import com.lone.demo.factorypattern.factory.WindowsDialog;

public class Demo {
    private static Dialog dialog;

    public static void main(String[] args) {
        configure();
        runBusinessLogic();
    }

    private static void configure() {
        if ("Windows 10".equals(System.getProperty("os.name"))) {
            dialog = new WindowsDialog();
        } else {
            dialog = new HtmlDialog();
        }
    }

    private static void runBusinessLogic() {
        dialog.renderWindow();
    }


}
